package com.oa.business.org.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.oa.common.DomainDto;
import com.oa.framework.org.domain.Permission;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class PermissionDto implements DomainDto<Permission> {
    @JsonSerialize(using=ToStringSerializer.class)
    private Long resourceId;

    private String permission;

    @Override
    public Permission transform() {
        Permission permission = new Permission();
        permission.setResourceId(this.resourceId);
        permission.setPermission(this.permission);
        return permission;
    }
}
